package com.seecen.cywbackend.config;

import com.seecen.cywbackend.interceptors.LoginProtectedIntercepter;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Resource
    private LoginProtectedIntercepter loginProtectedIntercepter;
    @Override
    public void addInterceptors(org.springframework.web.servlet.config.annotation.InterceptorRegistry registry) {
        registry.addInterceptor(loginProtectedIntercepter)
                .addPathPatterns("/**")
                .excludePathPatterns("/user/**");
    }
}
